﻿<%@ Page Language="c#" Inherits="WinnerCMS.WebUI.Admin.Main" CodeBehind="Main.aspx.cs" %>

<%@ Import Namespace="WinnerCMS.BLL" %>

<!doctype html>
<html>
<head runat="server">
    <title>起始页</title>
    <meta charset="utf-8" />
    <meta http-equiv="Pragma" content="No-cach" />
    <%: Scripts.Render("~/Scripts/AdminBase") %>
    <%: Styles.Render("~/Content/Bootstrap/css") %>

    <script type="text/javascript">
        var autoRefresh = false;
        $(document).ready(function () {
            GetRunningInfo();

            GetRequest();
            $("#autoRefresh").click(function () {
                autoRefresh = this.checked;
                GetRunningInfo();
            });
        });

        function GetRequest() {
            if ($("#updata").length < 1)
                return;

            $.ajax({
                type: "get",
                url: "../AjaxPostBack.ashx?Action=UpDataNews",
                beforeSend: function () {
                    $("#updata").html("数据正在加载。。。");
                },
                success: function (msg) {
                    $("#updata").html(msg);
                }
            });

        }



        function GetRunningInfo() {

            $.ajax({
                type: "get",
                url: "Main.aspx?Action=GetRunningInfo",
                dataType: "json",
                beforeSend: function () {

                },
                success: function (info) {
                    $("#lblaspnetn").text(info.lblaspnetn);
                    $("#lblaspnetcpu").text(info.lblaspnetcpu);
                    $("#lblserverstart").text(info.lblserverstart + " 小时");
                    $("#lblprstart").text(info.lblprstart);
                    $("#lblCpuUsage").text(info.lblCpuUsage);
                    $("#lblGetMaxThreads").text(info.lblGetMaxThreads);
                    $("#lblProcessThread").text(info.lblProcessThread);
                    $("#lbldwMemoryLoad").text(info.lbldwMemoryLoad);
                    $("#lbldwAvailPhys").text(info.lbldwAvailPhys);
                    $("#lbldwAvailPageFile").text(info.lbldwAvailPageFile);
                    $("#lblservers").text(info.lblservers);
                    $("#lblservera").text(info.lblservera);
                    $("#lblCache").text(info.lblCache);
                    $("#lblCacheMax").text(info.lblCacheMax);

                    if (autoRefresh) {

                        window.setTimeout("GetRunningInfo()", 4000);
                    }
                }
            });


        }
    </script>
    <style type="text/css">
        #lblCache, #lblservers {
            cursor: pointer;
        }
    </style>

</head>
<body>
    <form id="Form1" runat="server">
        <div class="easyui-tabs">
            <div title="服务器状态">
                <table width="100%" id="Tab0" class="table table-striped table-bordered table-hover">
                    <tr>
                        <td class="RowTitle">AspNet内存占用：</td>
                        <td class="AA">
                            <asp:Label ID="lblaspnetn" runat="server"></asp:Label></td>
                        <td class="RowTitle">AspNet CPU时间： </td>
                        <td class="AA">
                            <asp:Label ID="lblaspnetcpu" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="RowTitle">剩余内存： </td>
                        <td>
                            <asp:Label ID="lbldwMemoryLoad" runat="server"></asp:Label></td>
                        <td class="RowTitle">开机运行时长： </td>
                        <td>
                            <asp:Label ID="lblserverstart" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="RowTitle">&nbsp;系统占用CPU： </td>
                        <td>
                            <asp:Label ID="lblCpuUsage" runat="server"></asp:Label></td>
                        <td class="RowTitle">剩余物理内存： </td>
                        <td>
                            <asp:Label ID="lbldwAvailPhys" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="RowTitle">线程池线程数上限： </td>
                        <td>
                            <asp:Label ID="lblGetMaxThreads" runat="server"></asp:Label></td>
                        <td class="RowTitle">剩余交换文件： </td>
                        <td>
                            <asp:Label ID="lbldwAvailPageFile" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="RowTitle">当前AspNet运行线程数： </td>
                        <td>
                            <asp:Label ID="lblProcessThread" runat="server"></asp:Label></td>
                        <td class="RowTitle">进程开始时间： </td>
                        <td>
                            <asp:Label ID="lblprstart" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="RowTitle">网站Session总数： </td>
                        <td>
                            <asp:Label ID="lblservers" runat="server" onclick="NewTabPage('所有Session','ControlPanel/CacheExplorer.aspx?Type=Session');"></asp:Label></td>
                        <td class="RowTitle">Application总数： </td>
                        <td>
                            <asp:Label ID="lblservera" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="RowTitle">网站Cache总数： </td>
                        <td>
                            <asp:Label ID="lblCache" runat="server" onclick="NewTabPage('所有缓存','ControlPanel/CacheExplorer.aspx');"></asp:Label></td>
                        <td class="RowTitle">可用缓存容量： </td>
                        <td>
                            <asp:Label ID="lblCacheMax" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="RowTitle">数据总量：</td>
                        <td><span id="lblRowsCount" onclick="NewTabPage('数据总量','ControlPanel/CacheExplorer.aspx?Type=GetDBCount');"><%=new ModelManage().GetDBCount().Sum(x => x.Value).ToString("N0") %></span></td>
                        <td class="RowTitle">自动刷新：</td>
                        <td>
                            <input id="autoRefresh" type="checkbox" /></td>
                    </tr>
                </table>
            </div>
            <div title="全站信息">
                <table width="100%" id="Tab1" class="TabelGrid" cellpadding="6">
                    <tr>
                        <td align="right" valign="top"><strong>授权类型：</strong></td>
                        <td colspan="5" style="line-height: 200%;">产 品：<asp:Label ID="lblVersion" runat="server"></asp:Label>
                            <%= WinnerCMS.Licenses.License.CurrentEdition %><br />
                            数 据 库：<asp:Label ID="lblDataType" runat="server"></asp:Label>
                            <br />
                            <p>向支付宝账户winner2050@126.com支付以下表格金额数目即可认为购买了正版。 </p>
<table border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td width="137" valign="top"><p>&nbsp;</p></td>
    <td width="141" valign="top"><p align="center">源码 </p></td>
    <td width="138" valign="top"><p align="center">Git同步源码 </p></td>
    <td width="138" valign="top"><p align="right">金额 </p></td>
    <td width="138" valign="top"><p align="center">授权站点 </p></td>
  </tr>
  <tr>
    <td width="137" valign="top"><p>捐助版 </p></td>
    <td width="141" valign="top"><p align="center">√ </p></td>
    <td width="138" valign="top"><p align="center">× </p></td>
    <td width="138" valign="top"><p align="right">任意 </p></td>
    <td width="138" valign="top"><p align="center">不限制 </p></td>
  </tr>
  <tr>
    <td width="137" valign="top"><p>个人版 </p></td>
    <td width="141" valign="top"><p align="center">√ </p></td>
    <td width="138" valign="top"><p align="center">√ </p></td>
    <td width="138" valign="top"><p align="right">￥300.00</p></td>
    <td width="138" valign="top"><p align="center">三个站点 </p></td>
  </tr>
  <tr>
    <td width="137" valign="top"><p>企业版 </p></td>
    <td width="141" valign="top"><p align="center">√ </p></td>
    <td width="138" valign="top"><p align="center">√ </p></td>
    <td width="138" valign="top"><p align="right">￥1000.00</p></td>
    <td width="138" valign="top"><p align="center">三个站点 </p></td>
  </tr>
  <tr>
    <td width="691" colspan="5" valign="top"><p>说明：使用git来同步源码，方便以后程序升级了，您能方便的看到源码升级的变化。极大节省升级程序带来的影响，特别是自己还修改了源码。 <br />
      本程序属个人开发，很遗憾没法给个人版用户提供技术支持。 <br />
      咨询请电邮：winner2050@126.com</p></td>
  </tr>
</table>
                        </td>
                    </tr>
                </table>
            </div>
            <div title="程序开发">
                <table id="Tab2" width="100%" class="TabelGrid">
                    <tr>
                        <td class="RowTitle">程序制作： </td>
                        <td>www.WinnerCMS.com </td>
                    </tr>
                    <tr>
                        <td class="RowTitle">E_mail： </td>
                        <td>winner2050@126.com </td>
                    </tr>
                    <tr>
                        <td class="RowTitle">QQ：</td>
                        <td>538544651</td>
                    </tr>
                    <tr>
                        <td class="RowTitle">程序主页： </td>
                        <td><a href="http://www.WinnerCMS.com" target="_blank">www.WinnerCMS.com</a></td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
</body>
</html>
